{extend name="common/block" /}

{block name="content"}

<form class="layui-form" id="form">


{php}echo $html;{/php}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="create">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<pre class="layui-code">{$html}</pre>
<pre class="layui-code">$config={$data}


$html=(new Builder($config))->getHtml();</pre>
<div id="layout">
    <!--<div id="test-editormd" class="editormd editormd-vertical" style="width: 90%; height: 640px;"></div>-->
</div>

{/block}

{block name="script"}
<script>

    layui.use(['code', 'element', 'form'], function () {
        var form =layui.form;

        form.render();

        layui.code({
            title: 'php',
            about: false,
        }); //引用code方法
        form.on('submit(create)',function(){
            var fd = new FormData(document.getElementById("form"));
            fd.append('ueditor',ueditor.getContent());
            fd.append('content',content.getHtml());
            console.log(fd.get('ueditor'),fd.get('content'));
            return false;
            $.ajax({
                url:'{:url("admin/templet/create")}',
                type:'post',
                processData: false,//必须
                contentType: false,//必须
                data:fd,
                success:function(r){
                    if (r.code == 1) {
                        layer.msg(r.msg);
                    } else {
                        layer.msg(r.msg);
                    }
                },
                error:function(r){
                    layer.msg(r.msg);
                }
            })
            return false;
        })
    });


</script>
{/block}
